<?php

namespace App\Music\Faith;

use Hyperf\Di\Container;

class MusicApiFactory
{
    public function createMusicApi(string $serviceType): MusicApi
    {
        switch ($serviceType) {
            case 'tencent':
                return container()->get(TencentApi::class);
            case 'netease':
                return container()->get(NetEaseMusicApi::class);
            case 'migu':
                return container()->get(MiguMusicApi::class);
            default:
                throw new \RuntimeException('Unsupported music service type: ' . $serviceType);
        }
    }
}
